import Vue from 'vue'
import Vuex from 'vuex'

import getters from './getters'
import app from './modules/app'
import otherSetting from './modules/otherSetting'
import settings from './modules/settings'
import user from './modules/user'
import curRouteInfo from  './modules/curRouteInfo'
import tagsView from  './modules/tagsView'
import systemPermission from  './modules/systemPermission'
import versionList from  './modules/versionList'
// import cancelToken from  './modules/cancelToken'
//安装插件  这个不是写在main.js里面的
Vue.use(Vuex)

const store = new Vuex.Store({
  //全局的state  state:放入共享的状态信息(数据)  类似data
  state: {

  },
  //全局的mut
  // 定义处理state里面的数据的方法  类似methods
  mutations:{
  },
  //全局的act
  actions:{

  },
  //全局的getters
  getters,
  modules: {
    //三个模块分别由对应的state  actions mutations getters ...
    curRouteInfo,
    app,
    settings,
    user,
    tagsView,
    systemPermission,
    otherSetting,
    versionList
    // cancelToken
  },

})

export default store


/*
  //模块划分,意思是 虽然不推荐创建多个store,但是可以创建多个模块modules
  //a,b这俩属性会默认增加在state里面★★★★
    modules:{
      a:moduleA,
      b:moduleB
    }

})*/


